﻿using System;
namespace Producers.Taitis.Xtee.Riik.Ee.Producer.Taitis {
    
    
    [global::Xtee.Core.Attributes.XmlTypeAttribute(Name="paring3_vastus", Namespace="http://producers.taitis.xtee.riik.ee/producer/taitis", Target=typeof(Paring3Vastus))]
    public class Paring3VastusSerializer : global::Xtee.Core.Types.AbstractXteeSerializable {
        
        protected IParing3Vastus clazz;
        
        public Paring3VastusSerializer(IParing3Vastus clazz) {
            this.clazz = clazz;
        }
        
        public override void WriteXml(global::Xtee.Core.IXteeXmlWriter Writer) {
            base.WriteXml(Writer);
            Writer.WriteStartElement("teade");
            if (clazz.Teade!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.Teade))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Teade");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("toimiku_number");
            if (clazz.ToimikuNumber!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ToimikuNumber))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : ToimikuNumber");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("avamise_kpv");
            if (clazz.AvamiseKpv!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.AvamiseKpv))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : AvamiseKpv");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("menetlusseisund");
            if (clazz.Menetlusseisund!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.Menetlusseisund))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Menetlusseisund");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("lahendiliik");
            if (clazz.Lahendiliik!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.Lahendiliik))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Lahendiliik");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("lahendi_number");
            if (clazz.LahendiNumber!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.LahendiNumber))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : LahendiNumber");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("lahendikpv");
            if (clazz.Lahendikpv!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.Lahendikpv))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Lahendikpv");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("lahendi_tegija");
            if (clazz.LahendiTegija!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.LahendiTegija))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : LahendiTegija");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("taituri_eesnimi");
            if (clazz.TaituriEesnimi!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.TaituriEesnimi))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : TaituriEesnimi");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("taituri_perekonnanimi");
            if (clazz.TaituriPerekonnanimi!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.TaituriPerekonnanimi))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : TaituriPerekonnanimi");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("taituri_aadress");
            if (clazz.TaituriAadress!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.TaituriAadress))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : TaituriAadress");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("taituri_telefon");
            if (clazz.TaituriTelefon!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.TaituriTelefon))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : TaituriTelefon");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("taituri_faks");
            if (clazz.TaituriFaks!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.TaituriFaks))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : TaituriFaks");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("taituri_mail");
            if (clazz.TaituriMail!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.TaituriMail))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : TaituriMail");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("volgniku_eesnimi");
            if (clazz.VolgnikuEesnimi!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.VolgnikuEesnimi))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : VolgnikuEesnimi");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("volgniku_nimi");
            if (clazz.VolgnikuNimi!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.VolgnikuNimi))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : VolgnikuNimi");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("volgniku_kood");
            if (clazz.VolgnikuKood!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.VolgnikuKood))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : VolgnikuKood");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("volgniku_synnipaev");
            if (clazz.VolgnikuSynnipaev!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.VolgnikuSynnipaev))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : VolgnikuSynnipaev");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("volgniku_synnikuu");
            if (clazz.VolgnikuSynnikuu!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.VolgnikuSynnikuu))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : VolgnikuSynnikuu");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("volgniku_synniaasta");
            if (clazz.VolgnikuSynniaasta!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.VolgnikuSynniaasta))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : VolgnikuSynniaasta");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("volgniku_aadress_jada");
            if (clazz.VolgnikuAadressJada!=null) {
                Writer.WriteTypeAttribute("http://schemas.xmlsoap.org/soap/encoding/", "Array");
                Writer.WriteArrayTypeAttribute("aadress3", "http://producers.taitis.xtee.riik.ee/producer/taitis", clazz.VolgnikuAadressJada.Count);
                for (int x = 0; ((clazz.VolgnikuAadressJada != null) 
                            && (x < clazz.VolgnikuAadressJada.Count)); x = (x + 1)) {
                    if (clazz.VolgnikuAadressJada[x]!=null) {
                        Writer.WriteStartElement("item");
                        global::Xtee.Core.SerializationMetadata metaVolgnikuAadressJada = this.GetMetaData(clazz.VolgnikuAadressJada[x]);
                        Writer.WriteTypeAttribute(metaVolgnikuAadressJada.TypeQualifiedName.Namespace, metaVolgnikuAadressJada.TypeQualifiedName.Name);
                        metaVolgnikuAadressJada.NewSerializer(clazz.VolgnikuAadressJada[x]).WriteXml(Writer);
                        Writer.WriteEndElement();
                    }
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : VolgnikuAadressJada");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("noudja_eesnimi");
            if (clazz.NoudjaEesnimi!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.NoudjaEesnimi))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : NoudjaEesnimi");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("noudja_nimi");
            if (clazz.NoudjaNimi!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.NoudjaNimi))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : NoudjaNimi");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("noudja_kood");
            if (clazz.NoudjaKood!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.NoudjaKood))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : NoudjaKood");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("noudja_aadress_jada");
            if (clazz.NoudjaAadressJada!=null) {
                Writer.WriteTypeAttribute("http://schemas.xmlsoap.org/soap/encoding/", "Array");
                Writer.WriteArrayTypeAttribute("aadress3", "http://producers.taitis.xtee.riik.ee/producer/taitis", clazz.NoudjaAadressJada.Count);
                for (int x = 0; ((clazz.NoudjaAadressJada != null) 
                            && (x < clazz.NoudjaAadressJada.Count)); x = (x + 1)) {
                    if (clazz.NoudjaAadressJada[x]!=null) {
                        Writer.WriteStartElement("item");
                        global::Xtee.Core.SerializationMetadata metaNoudjaAadressJada = this.GetMetaData(clazz.NoudjaAadressJada[x]);
                        Writer.WriteTypeAttribute(metaNoudjaAadressJada.TypeQualifiedName.Namespace, metaNoudjaAadressJada.TypeQualifiedName.Name);
                        metaNoudjaAadressJada.NewSerializer(clazz.NoudjaAadressJada[x]).WriteXml(Writer);
                        Writer.WriteEndElement();
                    }
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : NoudjaAadressJada");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("noue_jada");
            if (clazz.NoueJada!=null) {
                Writer.WriteTypeAttribute("http://schemas.xmlsoap.org/soap/encoding/", "Array");
                Writer.WriteArrayTypeAttribute("noue3", "http://producers.taitis.xtee.riik.ee/producer/taitis", clazz.NoueJada.Count);
                for (int x = 0; ((clazz.NoueJada != null) 
                            && (x < clazz.NoueJada.Count)); x = (x + 1)) {
                    if (clazz.NoueJada[x]!=null) {
                        Writer.WriteStartElement("item");
                        global::Xtee.Core.SerializationMetadata metaNoueJada = this.GetMetaData(clazz.NoueJada[x]);
                        Writer.WriteTypeAttribute(metaNoueJada.TypeQualifiedName.Namespace, metaNoueJada.TypeQualifiedName.Name);
                        metaNoueJada.NewSerializer(clazz.NoueJada[x]).WriteXml(Writer);
                        Writer.WriteEndElement();
                    }
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : NoueJada");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("toimikunr_jada");
            if (clazz.ToimikunrJada!=null) {
                Writer.WriteTypeAttribute("http://schemas.xmlsoap.org/soap/encoding/", "Array");
                Writer.WriteArrayTypeAttribute("string", "http://www.w3.org/2001/XMLSchema", clazz.ToimikunrJada.Count);
                for (int x = 0; ((clazz.ToimikunrJada != null) 
                            && (x < clazz.ToimikunrJada.Count)); x = (x + 1)) {
                    if (clazz.ToimikunrJada[x]!=null) {
                        Writer.WriteStartElement("item");
                        Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                        Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ToimikunrJada[x]))).ToString());
                        Writer.WriteEndElement();
                    }
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : ToimikunrJada");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("dokument_jada");
            if (clazz.DokumentJada!=null) {
                Writer.WriteTypeAttribute("http://schemas.xmlsoap.org/soap/encoding/", "Array");
                Writer.WriteArrayTypeAttribute("dokument3", "http://producers.taitis.xtee.riik.ee/producer/taitis", clazz.DokumentJada.Count);
                for (int x = 0; ((clazz.DokumentJada != null) 
                            && (x < clazz.DokumentJada.Count)); x = (x + 1)) {
                    if (clazz.DokumentJada[x]!=null) {
                        Writer.WriteStartElement("item");
                        global::Xtee.Core.SerializationMetadata metaDokumentJada = this.GetMetaData(clazz.DokumentJada[x]);
                        Writer.WriteTypeAttribute(metaDokumentJada.TypeQualifiedName.Namespace, metaDokumentJada.TypeQualifiedName.Name);
                        metaDokumentJada.NewSerializer(clazz.DokumentJada[x]).WriteXml(Writer);
                        Writer.WriteEndElement();
                    }
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : DokumentJada");
            }
            Writer.WriteEndElement();
        }
        
        public override void ReadXml(global::Xtee.Core.IXteeXmlReader Reader) {
            base.ReadXml(Reader);
        START:
            if ((Reader.LocalName == "teade")) {
                goto teade;
            }
            else {
                if ((Reader.LocalName == "toimiku_number")) {
                    goto toimiku_number;
                }
                else {
                    if ((Reader.LocalName == "avamise_kpv")) {
                        goto avamise_kpv;
                    }
                    else {
                        if ((Reader.LocalName == "menetlusseisund")) {
                            goto menetlusseisund;
                        }
                        else {
                            if ((Reader.LocalName == "lahendiliik")) {
                                goto lahendiliik;
                            }
                            else {
                                if ((Reader.LocalName == "lahendi_number")) {
                                    goto lahendi_number;
                                }
                                else {
                                    if ((Reader.LocalName == "lahendikpv")) {
                                        goto lahendikpv;
                                    }
                                    else {
                                        if ((Reader.LocalName == "lahendi_tegija")) {
                                            goto lahendi_tegija;
                                        }
                                        else {
                                            if ((Reader.LocalName == "taituri_eesnimi")) {
                                                goto taituri_eesnimi;
                                            }
                                            else {
                                                if ((Reader.LocalName == "taituri_perekonnanimi")) {
                                                    goto taituri_perekonnanimi;
                                                }
                                                else {
                                                    if ((Reader.LocalName == "taituri_aadress")) {
                                                        goto taituri_aadress;
                                                    }
                                                    else {
                                                        if ((Reader.LocalName == "taituri_telefon")) {
                                                            goto taituri_telefon;
                                                        }
                                                        else {
                                                            if ((Reader.LocalName == "taituri_faks")) {
                                                                goto taituri_faks;
                                                            }
                                                            else {
                                                                if ((Reader.LocalName == "taituri_mail")) {
                                                                    goto taituri_mail;
                                                                }
                                                                else {
                                                                    if ((Reader.LocalName == "volgniku_eesnimi")) {
                                                                        goto volgniku_eesnimi;
                                                                    }
                                                                    else {
                                                                        if ((Reader.LocalName == "volgniku_nimi")) {
                                                                            goto volgniku_nimi;
                                                                        }
                                                                        else {
                                                                            if ((Reader.LocalName == "volgniku_kood")) {
                                                                                goto volgniku_kood;
                                                                            }
                                                                            else {
                                                                                if ((Reader.LocalName == "volgniku_synnipaev")) {
                                                                                    goto volgniku_synnipaev;
                                                                                }
                                                                                else {
                                                                                    if ((Reader.LocalName == "volgniku_synnikuu")) {
                                                                                        goto volgniku_synnikuu;
                                                                                    }
                                                                                    else {
                                                                                        if ((Reader.LocalName == "volgniku_synniaasta")) {
                                                                                            goto volgniku_synniaasta;
                                                                                        }
                                                                                        else {
                                                                                            if ((Reader.LocalName == "volgniku_aadress_jada")) {
                                                                                                goto volgniku_aadress_jada;
                                                                                            }
                                                                                            else {
                                                                                                if ((Reader.LocalName == "noudja_eesnimi")) {
                                                                                                    goto noudja_eesnimi;
                                                                                                }
                                                                                                else {
                                                                                                    if ((Reader.LocalName == "noudja_nimi")) {
                                                                                                        goto noudja_nimi;
                                                                                                    }
                                                                                                    else {
                                                                                                        if ((Reader.LocalName == "noudja_kood")) {
                                                                                                            goto noudja_kood;
                                                                                                        }
                                                                                                        else {
                                                                                                            if ((Reader.LocalName == "noudja_aadress_jada")) {
                                                                                                                goto noudja_aadress_jada;
                                                                                                            }
                                                                                                            else {
                                                                                                                if ((Reader.LocalName == "noue_jada")) {
                                                                                                                    goto noue_jada;
                                                                                                                }
                                                                                                                else {
                                                                                                                    if ((Reader.LocalName == "toimikunr_jada")) {
                                                                                                                        goto toimikunr_jada;
                                                                                                                    }
                                                                                                                    else {
                                                                                                                        if ((Reader.LocalName == "dokument_jada")) {
                                                                                                                            goto dokument_jada;
                                                                                                                        }
                                                                                                                        else {
                                                                                                                            return;
                                                                                                                        }
                                                                                                                    }
                                                                                                                }
                                                                                                            }
                                                                                                        }
                                                                                                    }
                                                                                                }
                                                                                            }
                                                                                        }
                                                                                    }
                                                                                }
                                                                            }
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        teade:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>paring3_vastus>teade");
            }
            clazz.Teade = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("teade")).Value;
            goto START;
        toimiku_number:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>paring3_vastus>toimiku_number");
            }
            clazz.ToimikuNumber = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("toimiku_number")).Value;
            goto START;
        avamise_kpv:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>paring3_vastus>avamise_kpv");
            }
            clazz.AvamiseKpv = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("avamise_kpv")).Value;
            goto START;
        menetlusseisund:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>paring3_vastus>menetlusseisund");
            }
            clazz.Menetlusseisund = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("menetlusseisund")).Value;
            goto START;
        lahendiliik:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>paring3_vastus>lahendiliik");
            }
            clazz.Lahendiliik = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("lahendiliik")).Value;
            goto START;
        lahendi_number:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>paring3_vastus>lahendi_number");
            }
            clazz.LahendiNumber = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("lahendi_number")).Value;
            goto START;
        lahendikpv:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>paring3_vastus>lahendikpv");
            }
            clazz.Lahendikpv = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("lahendikpv")).Value;
            goto START;
        lahendi_tegija:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>paring3_vastus>lahendi_tegija");
            }
            clazz.LahendiTegija = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("lahendi_tegija")).Value;
            goto START;
        taituri_eesnimi:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>paring3_vastus>taituri_eesnimi");
            }
            clazz.TaituriEesnimi = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("taituri_eesnimi")).Value;
            goto START;
        taituri_perekonnanimi:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>paring3_vastus>taituri_perekonnanimi");
            }
            clazz.TaituriPerekonnanimi = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("taituri_perekonnanimi")).Value;
            goto START;
        taituri_aadress:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>paring3_vastus>taituri_aadress");
            }
            clazz.TaituriAadress = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("taituri_aadress")).Value;
            goto START;
        taituri_telefon:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>paring3_vastus>taituri_telefon");
            }
            clazz.TaituriTelefon = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("taituri_telefon")).Value;
            goto START;
        taituri_faks:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>paring3_vastus>taituri_faks");
            }
            clazz.TaituriFaks = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("taituri_faks")).Value;
            goto START;
        taituri_mail:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>paring3_vastus>taituri_mail");
            }
            clazz.TaituriMail = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("taituri_mail")).Value;
            goto START;
        volgniku_eesnimi:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>paring3_vastus>volgniku_eesnimi");
            }
            clazz.VolgnikuEesnimi = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("volgniku_eesnimi")).Value;
            goto START;
        volgniku_nimi:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>paring3_vastus>volgniku_nimi");
            }
            clazz.VolgnikuNimi = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("volgniku_nimi")).Value;
            goto START;
        volgniku_kood:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>paring3_vastus>volgniku_kood");
            }
            clazz.VolgnikuKood = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("volgniku_kood")).Value;
            goto START;
        volgniku_synnipaev:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>paring3_vastus>volgniku_synnipaev");
            }
            clazz.VolgnikuSynnipaev = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("volgniku_synnipaev")).Value;
            goto START;
        volgniku_synnikuu:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>paring3_vastus>volgniku_synnikuu");
            }
            clazz.VolgnikuSynnikuu = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("volgniku_synnikuu")).Value;
            goto START;
        volgniku_synniaasta:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>paring3_vastus>volgniku_synniaasta");
            }
            clazz.VolgnikuSynniaasta = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("volgniku_synniaasta")).Value;
            goto START;
        volgniku_aadress_jada:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>paring3_vastus>volgniku_aadress_jada");
            }
            clazz.VolgnikuAadressJada = new System.Collections.Generic.List<global::Producers.Taitis.Xtee.Riik.Ee.Producer.Taitis.IAadress3>();
            if ((Reader.IsEmptyElement == false)) {
                Reader.ReadStartElement("volgniku_aadress_jada");
                for (; ((Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
                            && (Reader.LocalName == "item")); ) {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>paring3_vastus>volgniku_aadress_jada>item");
                    }
                    global::Xtee.Core.SerializationMetadata metaVolgnikuAadressJada = this.GetMetaData<global::Producers.Taitis.Xtee.Riik.Ee.Producer.Taitis.IAadress3>(Reader, "aadress3", "http://producers.taitis.xtee.riik.ee/producer/taitis");
                    global::Producers.Taitis.Xtee.Riik.Ee.Producer.Taitis.IAadress3 item = metaVolgnikuAadressJada.NewEntity<global::Producers.Taitis.Xtee.Riik.Ee.Producer.Taitis.IAadress3>();
                    clazz.VolgnikuAadressJada.Add(item);
                    if ((Reader.IsEmptyElement == false)) {
                        Reader.ReadStartElement("item");
                        metaVolgnikuAadressJada.NewSerializer(item).ReadXml(Reader);
                        Reader.ReadEndElement();
                    }
                    else {
                        Reader.Skip();
                    }
                }
                Reader.ReadEndElement();
            }
            else {
                Reader.Skip();
            }
            goto START;
        noudja_eesnimi:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>paring3_vastus>noudja_eesnimi");
            }
            clazz.NoudjaEesnimi = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("noudja_eesnimi")).Value;
            goto START;
        noudja_nimi:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>paring3_vastus>noudja_nimi");
            }
            clazz.NoudjaNimi = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("noudja_nimi")).Value;
            goto START;
        noudja_kood:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>paring3_vastus>noudja_kood");
            }
            clazz.NoudjaKood = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("noudja_kood")).Value;
            goto START;
        noudja_aadress_jada:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>paring3_vastus>noudja_aadress_jada");
            }
            clazz.NoudjaAadressJada = new System.Collections.Generic.List<global::Producers.Taitis.Xtee.Riik.Ee.Producer.Taitis.IAadress3>();
            if ((Reader.IsEmptyElement == false)) {
                Reader.ReadStartElement("noudja_aadress_jada");
                for (; ((Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
                            && (Reader.LocalName == "item")); ) {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>paring3_vastus>noudja_aadress_jada>item");
                    }
                    global::Xtee.Core.SerializationMetadata metaNoudjaAadressJada = this.GetMetaData<global::Producers.Taitis.Xtee.Riik.Ee.Producer.Taitis.IAadress3>(Reader, "aadress3", "http://producers.taitis.xtee.riik.ee/producer/taitis");
                    global::Producers.Taitis.Xtee.Riik.Ee.Producer.Taitis.IAadress3 item = metaNoudjaAadressJada.NewEntity<global::Producers.Taitis.Xtee.Riik.Ee.Producer.Taitis.IAadress3>();
                    clazz.NoudjaAadressJada.Add(item);
                    if ((Reader.IsEmptyElement == false)) {
                        Reader.ReadStartElement("item");
                        metaNoudjaAadressJada.NewSerializer(item).ReadXml(Reader);
                        Reader.ReadEndElement();
                    }
                    else {
                        Reader.Skip();
                    }
                }
                Reader.ReadEndElement();
            }
            else {
                Reader.Skip();
            }
            goto START;
        noue_jada:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>paring3_vastus>noue_jada");
            }
            clazz.NoueJada = new System.Collections.Generic.List<global::Producers.Taitis.Xtee.Riik.Ee.Producer.Taitis.INoue3>();
            if ((Reader.IsEmptyElement == false)) {
                Reader.ReadStartElement("noue_jada");
                for (; ((Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
                            && (Reader.LocalName == "item")); ) {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>paring3_vastus>noue_jada>item");
                    }
                    global::Xtee.Core.SerializationMetadata metaNoueJada = this.GetMetaData<global::Producers.Taitis.Xtee.Riik.Ee.Producer.Taitis.INoue3>(Reader, "noue3", "http://producers.taitis.xtee.riik.ee/producer/taitis");
                    global::Producers.Taitis.Xtee.Riik.Ee.Producer.Taitis.INoue3 item = metaNoueJada.NewEntity<global::Producers.Taitis.Xtee.Riik.Ee.Producer.Taitis.INoue3>();
                    clazz.NoueJada.Add(item);
                    if ((Reader.IsEmptyElement == false)) {
                        Reader.ReadStartElement("item");
                        metaNoueJada.NewSerializer(item).ReadXml(Reader);
                        Reader.ReadEndElement();
                    }
                    else {
                        Reader.Skip();
                    }
                }
                Reader.ReadEndElement();
            }
            else {
                Reader.Skip();
            }
            goto START;
        toimikunr_jada:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>paring3_vastus>toimikunr_jada");
            }
            clazz.ToimikunrJada = new System.Collections.Generic.List<System.String>();
            if ((Reader.IsEmptyElement == false)) {
                Reader.ReadStartElement("toimikunr_jada");
                for (; ((Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
                            && (Reader.LocalName == "item")); ) {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>paring3_vastus>toimikunr_jada>item");
                    }
                    clazz.ToimikunrJada.Add(new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("item")).Value);
                }
                Reader.ReadEndElement();
            }
            else {
                Reader.Skip();
            }
            goto START;
        dokument_jada:
            if (Reader.IsElementNil()) {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>paring3_vastus>dokument_jada");
            }
            clazz.DokumentJada = new System.Collections.Generic.List<global::Producers.Taitis.Xtee.Riik.Ee.Producer.Taitis.IDokument3>();
            if ((Reader.IsEmptyElement == false)) {
                Reader.ReadStartElement("dokument_jada");
                for (; ((Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
                            && (Reader.LocalName == "item")); ) {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>paring3_vastus>dokument_jada>item");
                    }
                    global::Xtee.Core.SerializationMetadata metaDokumentJada = this.GetMetaData<global::Producers.Taitis.Xtee.Riik.Ee.Producer.Taitis.IDokument3>(Reader, "dokument3", "http://producers.taitis.xtee.riik.ee/producer/taitis");
                    global::Producers.Taitis.Xtee.Riik.Ee.Producer.Taitis.IDokument3 item = metaDokumentJada.NewEntity<global::Producers.Taitis.Xtee.Riik.Ee.Producer.Taitis.IDokument3>();
                    clazz.DokumentJada.Add(item);
                    if ((Reader.IsEmptyElement == false)) {
                        Reader.ReadStartElement("item");
                        metaDokumentJada.NewSerializer(item).ReadXml(Reader);
                        Reader.ReadEndElement();
                    }
                    else {
                        Reader.Skip();
                    }
                }
                Reader.ReadEndElement();
            }
            else {
                Reader.Skip();
            }
            goto START;
        }
    }
}
